<?

function isSkipped($value) {
	if ($value == 'SKIPPED_INFORMED' || $value == 'SKIPPED') {
		return true;
	}
	
	return false;
}

function getTableExtension($isArchive) {
	if ($isArchive) return "_archive";
	else return "";
}

function getTeamPlayer($row) {
	$draftItem = getSelectedPlayer($row);
	$draftItem->pickNumber = $row['pickNumber'];
	
	return $draftItem;
}

function getSelectedPlayer($row) {
	$draftItem = new TeamPlayer();
	$draftItem->coachName = $row['coachName'];
	$player = new Player();
	$player->id = $row['playerId'];
	$player->playerFirstName = $row['firstName'];
	$player->playerSurname = $row['surname'];
	$player->team = $row['team'];
	$player->playerType = $row['playerType'];
	$draftItem->player = $player;
	$draftItem->playerPosition = $row['playerPosition'];
	$draftItem->isLti = $row['isLti'];
	$draftItem->isLtiReplacement = $row['isLtiReplacement'];
	$draftItem->positionInAFLTeam = $row['position'];
	$draftItem->roundsSincePlayed = getRoundsSincePlayed($player->id);
    $draftItem->playerInfo = getPlayerInfo($player->id, $draftItem->roundsSincePlayed);
	
	return $draftItem;
}

?>